import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { UserLoginLogVO, UserLoginLogForm, UserLoginLogQuery } from '@/api/mushcoin/userLoginLog/types';

/**
 * 查询TG游戏登录日志列表
 * @param query
 * @returns {*}
 */

export const listUserLoginLog = (query?: UserLoginLogQuery): AxiosPromise<UserLoginLogVO[]> => {
  return request({
    url: '/mushcoin/userLoginLog/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询TG游戏登录日志详细
 * @param id
 */
export const getUserLoginLog = (id: string | number): AxiosPromise<UserLoginLogVO> => {
  return request({
    url: '/mushcoin/userLoginLog/' + id,
    method: 'get'
  });
};

/**
 * 新增TG游戏登录日志
 * @param data
 */
export const addUserLoginLog = (data: UserLoginLogForm) => {
  return request({
    url: '/mushcoin/userLoginLog',
    method: 'post',
    data: data
  });
};

/**
 * 修改TG游戏登录日志
 * @param data
 */
export const updateUserLoginLog = (data: UserLoginLogForm) => {
  return request({
    url: '/mushcoin/userLoginLog',
    method: 'put',
    data: data
  });
};

/**
 * 删除TG游戏登录日志
 * @param id
 */
export const delUserLoginLog = (id: string | number | Array<string | number>) => {
  return request({
    url: '/mushcoin/userLoginLog/' + id,
    method: 'delete'
  });
};
